package com.fmx.BookStore.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fmx.BookStore.core.domain.BaseEntity;
import org.springframework.stereotype.Component;

@Component
public class User extends BaseEntity {
    //用户ID
    private Long userId;
    //用户姓名
    private String userName;
    //用户密码
    private String password;
    //角色ID
    private Long roleId;
    @TableField(exist = false)
    private Role role;

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    public User() {
    }

    public User(Long userId, String userName, String password, Long roleId, Role role) {
        this.userId = userId;
        this.userName = userName;
        this.password = password;
        this.roleId = roleId;
        this.role = role;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", roleId=" + roleId +
                ", role=" + role +
                '}';
    }
}
